<script>
export default {
  data() {
    return {
      keepAliveInclude: [],
      meta: {
        showTabBar: true
      }
    }
  },
  onLaunch: function() {
    console.log('App Launch');
    // 检查登录状态
    this.checkLoginStatus();
  },
  onShow: function() {
    console.log('App Show');
  },
  onHide: function() {
    console.log('App Hide');
  },
  methods: {
    // 检查登录状态
    checkLoginStatus() {
      const token = uni.getStorageSync('token');
      if (!token) {
        // 未登录，跳转到登录页
        uni.navigateTo({
          url: '/pages/login/index'
        });
      }
    }
  }
};
</script>

<style>
/* 公共样式 */
page {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
    Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei',
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f8f8f8;
  -webkit-font-smoothing: antialiased;
}

/* 清除默认样式 */
view, text, image, button, input, textarea, form, navigator {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 公共卡片样式 */
.card {
  margin: 10px;
  padding: 15px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  padding: 0 15px;
  border-radius: 4px;
  font-size: 14px;
  color: #ffffff;
  background-color: #1296db;
}

/* 表单样式 */
.form-item {
  margin-bottom: 15px;
}

.form-label {
  margin-bottom: 5px;
  font-size: 14px;
  color: #666;
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #333;
}

/* 列表样式 */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #ffffff;
  border-bottom: 1px solid #f2f2f2;
}

/* 状态标签样式 */
.status-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #ffffff;
}
.status-wait {
  background-color: #e6a23c;
}
.status-success {
  background-color: #67c23a;
}
.status-fail {
  background-color: #f56c6c;
}
.status-disabled {
  background-color: #909399;
}
</style> 